﻿using Kernelx.Common.Clauses;
using Kernelx.Contexts.Defaults;
using Kernelx.Extensions._Internals.Clauses;
using System;
using System.Linq.Expressions;

namespace Kernelx.Extensions._Internals
{

    internal class ClauseConverter : IClauseConverter
    {

        public IClauseElement CreateClauseElement(Expression expr) => Expression2ClauseElement.GetClauseElement(expr);

        public LambdaExpression CreateLambdaExpression(IClauseElement clause, Type targetType, ParameterExpression parameter = null)
            => ClauseElement2Expression.CreateLambdaExpression(clause, targetType, parameter);
    }
}
